package com.xiaoshuidi.cloud.module.member.controller.admin.point.vo;

import com.xiaoshuidi.cloud.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;

@Data
public class MemberPointsPageReqVo extends PageParam {

    @Schema(description = "更新日期开始")
    private String beginTime;

    @Schema(description = "更新日期结束")
    private String endTime;

    @Schema(description = "等级")
    private Integer rank;

    @Schema(description = "最小积分")
    private Integer minPoint;

    @Schema(description = "最大积分")
    private Integer maxPoint;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "租客id")
    private Long tenantUserId;

    public String getBeginTime() {
        if(StringUtils.isNotBlank(beginTime)){
            return beginTime.concat(" 00:00:00");
        }
        return beginTime;
    }

    public String getEndTime() {
        if(StringUtils.isNotBlank(endTime)){
            return endTime.concat(" 23:59:59");
        }
        return endTime;
    }
}
